package com.zhanglu.fun.services.chatroom.client;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import com.zhanglu.fun.services.chatroom.bean.request.TokenRequest;
import com.zhanglu.fun.tookit.jwt.AuthenticationUser;

/**
 * @description
 * @Auther zhanglu
 * @Date 2017/9/20 下午4:08
 */

@FeignClient("AUTHENTICATIONCENTER")
public interface AuthenticationClient {
    @GetMapping("/fun/secure/token")
    String getToken(@RequestParam("username") String username, @RequestParam("password") String password);

    @PutMapping("/fun/secure/token")
    String registerToken(@RequestBody TokenRequest tokenRequest);

    @PostMapping("/fun/secure/token")
    String refreshToken(@RequestBody TokenRequest tokenRequest);

    @DeleteMapping("/fun/secure/token")
    boolean deleteToken(@RequestParam("token") String token);
}
